Communication apparatus, method for controlling communication apparatus, and program

ABSTRACT

A communication apparatus includes a determination device configured to, in a case where the communication apparatus connects to a first network of a first base station via a first frequency channel and the communication apparatus participates in a second network via the first frequency channel without connection to a base station, determine whether a second frequency channel used by a second base station is usable in the communication performed, and a control device configured to control the communication without connection to the base station according to the determination by the determination device.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a communication apparatus capable ofparticipating in a plurality of networks, a method for controlling thecommunication apparatus, and a program.

2. Description of the Related Art

In wireless communication, such as a wireless local area network (LAN)which is atypical example, conforming with the standard series ofInstitute of Electrical and Electronics Engineers (IEEE) 802.11, aninfrastructure mode, in which an access point (a base station) controlsa network, and an ad-hoc mode, in which terminal apparatusesautonomously form a network, are defined.

A method for realizing connection to a base station in theinfrastructure mode and simultaneously communicating with anotherterminal apparatus in the ad-hoc mode has been discussed (for example,see Japanese Patent Application Laid-Open No. 2005-64552).

The function constituting a plurality of networks using a singleterminal apparatus is called a multi-basic service set (BSS) function.The multi-BSS function may be performed on a single wireless LANinterface due to a reason such as cost reduction. When the connectionwith a base station in the infrastructure mode and simultaneouscommunication with other terminal apparatuses in the ad-hoc mode arerealized by the multi-BSS function, the communication of each mode isperformed on the same wireless LAN channel (a frequency channel).Therefore, when the wireless LAN channel on the side of theinfrastructure mode (an infrastructure mode) is changed due to a reasonsuch as roaming, the communication on the side of the ad-hoc mode alsoneeds to be changed to the same wireless LAN channel.

A case will be considered in which a terminal apparatus establishingconnection to a base station in the infrastructure mode andsimultaneously communicating with another terminal in the ad-hoc modechanges the communication channel of the side of the infrastructure modebecause of roaming. In this case, when the terminal apparatus alsochanges the communication channel of the side of the ad-hoc mode, theterminal apparatus is separated from the ad-hoc network.

Therefore, communication with another terminal apparatus present in thead-hoc network may become unavailable. Herein, when the other terminalapparatus detects the separation of the terminal apparatus havingperformed the roaming, the other terminal apparatus can detect theterminal apparatus having performing the roaming on another channel byscanning the wireless network. However, when the terminal apparatushaving performed the roaming already ends the ad-hoc mode communication,the other terminal apparatus consequently scans the wireless network invain in spite of the fact that the other terminal apparatus cannotdetect the terminal apparatus having performed the roaming.

Thus, since the other terminal apparatus cannot comprehend theseparation reason of the terminal apparatus separated from the ad-hocnetwork, a process suitable for the situation is not performed, andthere is an issue that usability is poor.

Further, in wireless LAN channels in which communication is available inthe infrastructure mode, some wireless LAN channels exist in whichcommunication is prohibited in the ad-hoc mode, for example, to sharewith meteorological radar.

SUMMARY OF THE INVENTION

According to an aspect of the invention, a communication apparatusincludes a first communication device configured to performcommunication by connecting to a base station, a second communicationdevice configured to perform communication without connection to a basestation, a determination device configured to, in a case where thecommunication apparatus connects to a first network of a first basestation via a first frequency channel by the first communication deviceand the communication apparatus participates in a second network via thefirst frequency channel without connection to the base station by thesecond communication device, determine whether a second frequencychannel used by a second base station is usable in the communicationperformed by the second communication device, and a control deviceconfigured to control the communication without connection to the basestation by the second communication device according to thedetermination by the determination device.

Further features and aspects of the present invention will becomeapparent from the following detailed description of exemplaryembodiments with reference to the attached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of the specification, illustrate exemplary embodiments, features,and aspects of the invention and, together with the description, serveto explain the principles of the invention.

FIG. 1 is a block diagram illustrating a configuration of acommunication apparatus according to an exemplary embodiment of thepresent invention.

FIG. 2 is a diagram illustrating software functions of the communicationapparatus according to the exemplary embodiment of the presentinvention.

FIG. 3 is a diagram illustrating a network configuration according tothe exemplary embodiment of the present invention.

FIG. 4 is a flowchart illustrating a process at the time of a networkswitchover of the communication apparatus according to the exemplaryembodiment of the present invention.

FIG. 5 is a diagram illustrating a first process sequence of a terminal301, a terminal 302, an access point (hereinafter, may be referred to asan “AP”) 303, and an access point 304 in the network configurationaccording to the exemplary embodiment of the present invention.

FIG. 6 is a diagram illustrating a second process sequence of theterminal 301, the terminal 302, the access point 303, and the accesspoint 304 in the network configuration according to the exemplaryembodiment of the present invention.

FIG. 7 is a diagram illustrating a third process sequence of theterminal 301, the terminal 302, the access point 303, and the accesspoint 304 in the network configuration according to the exemplaryembodiment of the present invention.

DESCRIPTION OF THE EMBODIMENTS

Various exemplary embodiments, features, and aspects of the inventionwill be described in detail below with reference to the drawings.

Hereinafter, a first exemplary embodiment of the present invention willbe described. A use example of a wireless LAN system conforming with theseries of IEEE 802.11 will be described below, but a communicationscheme is not limited to the wireless LAN conforming with the IEEE802.11.

A hardware configuration according to the present exemplary embodimentwill be described. FIG. 1 is a block diagram illustrating an example ofthe configuration of each apparatus to be described below. An entirecommunication apparatus 101 is illustrated. A control unit 102 controlsthe entire communication apparatus by executing a control program storedin a storage unit 103, and includes a computer such as a CPU or an MPU.The control unit 102 also performs execution control of an automaticcommunication parameter setting process performed with anotherapparatus. The storage unit 103 stores a control computer programexecuted by the control unit 102 and various kinds of information suchas a communication parameter. The control unit 102 executes the controlprogram stored in the storage unit 103 to perform various processes tobe described below. The storage unit 103 may include a memory such as aROM or a RAM, a flexible disk, a hard disk, an optical disc, amagneto-optical disc, a CD-ROM, a CD-R, a magnetic tape, a non-volatilememory card, a DVD, and the like.

A wireless unit 104 performs wireless communication. A display unit 105performs various displays and has a function of outputting visuallyrecognizable information, as in an LCD or an LED, or outputting a sound,as in a speaker or the like. An input unit 106 is used by a user toperform various inputs. An antenna control unit 107 and an antenna 108are provided.

FIG. 2 is a diagram illustrating an example of the configuration ofsoftware functional blocks performed by a communication apparatus thatsupports a multi-BSS function in a process to be described below. Anentire apparatus 201 is illustrated. A packet transmission unit 202transmits packets associated with various kinds of communication. Thetransmission of each signal to be described below is performed by thepacket transmission unit 202. A packet reception unit 203 receivespackets associated with various kinds of communication. The reception ofeach signal to be described below is performed by the packet receptionunit 203. A BSS terminal station (STA) function control unit 204controls a process of an infrastructure mode network (BSS) STA, which isconnected to a base station (an access point) and performs wirelesscommunication. The BSS-STA function control unit 204 performs processesof the infrastructure mode terminal station in a wireless LAN network,such as processes for transmitting and receiving a search signal of thebase station and a process for connection with the base station. Anindependent basic service set (IBSS) STA function control unit 205controls a process of an ad-hoc mode (IBSS) STA performing wirelesscommunication without connection to the base station. The IBSS-STAfunction control unit 205 performs the process of the ad-hoc modeterminal station to be described below. A connection networkconfirmation control unit 206 confirms and controls a connection statusof the apparatus itself with the network. The connection networkconfirmation control unit 206 performs a process at the time of anetwork switchover to be described below.

FIG. 3 is a diagram illustrating a network group formed by acommunication apparatus 301, a communication apparatus 302, an accesspoint 303, and an access point 304. The communication apparatuses 301and 302 have the configurations described in FIGS. 1 and 2. Thecommunication apparatus 301 is connected to a BSS network 305 managed bythe access point 303. The communication apparatuses 301 and 302participate in an IBSS network 307. The access point 304 manages a BSSnetwork 306. The BSS network is a basic network of the infrastructuremode. The IBSS network is a basic network of the ad-hoc mode.

In the present exemplary embodiment, the networks 305 and 307 have thesame extended service set identification (ESSID), and thus areconfigured as networks capable of performing roaming.

FIG. 4 is a flowchart illustrating a switchover process performed by theconnection network confirmation control unit 206, when the communicationapparatus 301 performing the multi-BSS function switches over (performsroaming) from the BSS network 305, to which the communication apparatus301 is currently being connected, to the other BSS network 306. Theswitchover process in FIG. 4 is performed, when the control unit 102reads and executes a computer program stored in the storage unit 103.

The process of FIG. 4 is performed, for example, when the network isswitched by wireless LAN roaming. The switchover process may beperformed, not only when wireless LAN roaming is performed, but alsowhen the communication apparatus 301 is separated from the network, towhich the communication apparatus 301 currently realizes BSS connection,and then detects another connectable network.

When the communication apparatus 301 is connected to the access point303 in a wireless connection environment of the access point 303, thecommunication apparatus 301 establishes wireless connection to theaccess point 304, that is, the communication apparatus 301 starts aroaming process in that a wireless connection environment to the accesspoint 304 becomes better.

When the connection network confirmation control unit 206 of thecommunication apparatus 301 detects the start of the roaming process,the connection network confirmation control unit 206 of thecommunication apparatus 301 determines whether the connections to thenetwork of the infrastructure mode and to the network of the ad-hoc modeare in progress by the multi-BSS function. When the connections to thenetwork of the infrastructure mode and the network of the ad-hoc modeare in progress by the multi-BSS function, the process of FIG. 4 isstarted. When only the connection to the network of the infrastructuremode is in progress, the roaming to the BSS network 306 of the accesspoint 304 is performed.

In the process of FIG. 4, in step S401, the connection networkconfirmation control unit 206 of the communication apparatus 301confirms whether the ad-hoc mode communication is available on thewireless LAN channel (a frequency channel) of the network after theswitchover. Herein, the connection network confirmation control unit 206confirms whether the wireless LAN channel to be used by the access point304 of the BSS network 306, which is the wireless LAN channel of thenetwork after the switchover, is a wireless LAN channel in whichcommunication is prohibited in the ad-hoc mode.

When the network after the switchover is the wireless LAN channel inwhich communication is available in the ad-hoc mode (YES in step S401),then in step S402, the BSS-STA function control unit 204 notifiesanother terminal in progress of the ad-hoc mode communication that thecommunication apparatus 301 itself switches the wireless LAN channel.Herein, information indicating that the communication apparatus 301itself switches the wireless LAN channel and information indicating thewireless LAN channel of the switching destination are broadcasted to thead-hoc network before the switchover. By the notification of step S402,another communication apparatus can swiftly detect the switchover of thewireless LAN channel. Therefore, another communication apparatus canswiftly perform an appropriate process. For example, anothercommunication apparatus can follow and change the wireless LAN channel.

After the notification in step S402, in step S403, the BSS-STA functioncontrol unit 204 changes the wireless LAN channel of the ad-hoc mode,and then in step S404, the IBSS-STA function control unit 205 switchesthe network of the infrastructure mode, so that communication isperformed in the switching destination network. The switchover of thenetwork of the infrastructure mode is performed by switching to thewireless LAN channel of the switching destination network (herein, theBSS network 306). However, the IBSS-STA function control unit 205 alsoperforms a process for establishing connection to the access point 304.

Conversely, when the network to be switched is operating on the wirelessLAN channel in which communication is not available in the ad-hoc modeas the determination result of step S401 (NO in step S401), then in stepS405, the connection network confirmation control unit 206 confirmssetting information to confirm which mode is prioritized between theinfrastructure mode and the ad-hoc mode when the communication apparatus301 performs the process. The setting information referred to in stepS405 is stored in the storage unit 103. The setting information can bechanged via a user's operation of the input unit 106.

When it is determined that the communication apparatus 301 prioritizesthe infrastructure mode in step S405 (YES in step S405), then in stepS406, the BSS-STA function control unit 204 notifies another terminal inprogress of the ad-hoc mode communication that the communicationapparatus 301 itself ends the ad-hoc mode communication.

After this notification, in step S407, the BSS-STA function control unit204 ends the ad-hoc mode communication. In step S404, the IBSS-STAfunction control unit 205 switches the network of the infrastructuremode, and then performs communication in the switching destinationnetwork.

When it is set that the communication apparatus 301 prioritizes thead-hoc mode in step S405 (NO in step S405), then in step S408, theIBSS-STA function control unit 205 ends the communication of theinfrastructure mode and ends the process. Note that, when it is set thatthe communication apparatus 301 prioritizes the ad-hoc mode in stepS405, the communication apparatus 301 does not perform roaming from theBSS network 305 to the BSS network 306. Therefore, the communicationapparatus 301 continues the wireless connection with the access point303, as long as the communication apparatus 301 can make the wirelessconnection with the access point 303 in the BSS network 305.

In the notification process of step S402, a broadcast message istransmitted to the ad-hoc network. However, the message may be exchangedindividually between the respective communication apparatuses.

In the setting information referred to in step S405, a priority mode maybe fixedly set. For example, the infrastructure mode is normallyprioritized. Alternatively, the mode may be dynamically set according toan application that is being executed. For example, a process mode maybe prioritized during real-time communication.

When the wireless LAN channel is used in which the network after theswitchover is the same as the network before the switchover, theconnection network confirmation control unit 206 may switch the networkwithout performing the process illustrated in FIG. 4.

FIG. 5 is a diagram illustrating a connection processing sequence of acase in which the communication apparatus 301 performs wireless LANroaming due to a reason such as movement of the communication apparatus301 and switches the connection to the BSS network 306 of the accesspoint 304, when the communication apparatus 301 is connected to theaccess point 303. Herein, since the communication apparatus 301 performsthe multi-BSS function, the communication apparatus 301 forms the IBSSnetwork 307 with the communication apparatus 302 to perform the ad-hocmode communication therebetween. The BSS network 305 and the IBSSnetwork 307 operate on a wireless LAN channel a (a frequency channel a).The BSS network 306 is assumed to operate on a wireless LAN channel b (afrequency channel b) in which the ad-hoc mode communication isavailable.

In step F501, the communication apparatus 301 detects loss of a beaconfrom the access point 303 and starts a wireless LAN roaming process.

In step F502, the communication apparatus 301 searches for aneighborhood AP, for example, by scanning wireless LANs. Then in stepF503, when the communication apparatus 301 receives a response signalfrom the access point 304, the communication apparatus 301 selects thenetwork 306 as a roaming destination.

After the communication apparatus 301 selects the network 306, then instep F504, the communication apparatus 301 performs the networkswitchover process described in FIG. 4. Since the ad-hoc modecommunication is available on the wireless LAN channel b, thecommunication apparatus 301 notifies the communication apparatus 302 ofan intention to change the wireless LAN channel of the communicationapparatus 301 itself and of switchover to the wireless LAN channel b.

After this notification, in step F505, the communication apparatus 301switches the wireless LAN channel of the ad-hoc mode to the wireless LANchannel b. Likewise, in step F506, the communication apparatus 302having received the notification changes the wireless LAN channel of thead-hoc mode to the wireless LAN channel b.

After the communication apparatus 301 changes the wireless LAN channelof the ad-hoc mode, then in step F507, the communication apparatus 301connects to the network 306 to complete the wireless LAN roaming.

Thus, when the wireless LAN channel of the infrastructure mode isswitched to the channel in which the ad-hoc mode communication isavailable by performing the switchover process described in FIG. 4, theswitchover to the wireless LAN channel of the ad-hoc mode can be swiftlyperformed.

FIG. 6 is a diagram illustrating a connection processing sequence of acase in which the communication apparatus 301 switches the connection tothe BSS network 306 operating on a wireless LAN channel c, in which thead-hoc mode communication is not available. Herein, it is set that thecommunication apparatus 301 prioritizes the communication of theinfrastructure mode.

In step F601, the communication apparatus 301 detects loss of a beaconfrom the access point 303 and starts a wireless LAN roaming process.

In step F602, the communication apparatus 301 searches for aneighborhood AP, for example, by scanning wireless LANs. Then in stepF603, when the communication apparatus 301 receives a response signalfrom the access point 304, the communication apparatus 301 selects thenetwork 306 as a roaming destination.

After the communication apparatus 301 selects the network 306, then instep F604, the communication apparatus 301 performs the networkswitchover process described in FIG. 4. Since the ad-hoc modecommunication is not available on the wireless LAN channel c, thecommunication apparatus 301 notifies the communication apparatus 302 ofan intention to end the ad-hoc mode communication.

After this notification, in step F605, the communication apparatus 301ends the ad-hoc mode communication. Likewise, in step F606, thecommunication apparatus 302 having received the notification also endsthe ad-hoc mode communication.

After the communication apparatus 301 ends the ad-hoc modecommunication, then in step F607, the communication apparatus 301connects to the network 306 to complete the wireless LAN roaming.

FIG. 7 is a diagram illustrating a sequence of a case in which thenetwork of the access point 304 serving as a roaming target operates onthe wireless LAN channel c, in which the ad-hoc mode communication isnot available. In this case, the communication apparatus 301 is set toprioritize the ad-hoc mode communication.

In step F701, the communication apparatus 301 detects loss of a beaconfrom the access point 303 and starts a wireless LAN roaming process.

In step F702, the communication apparatus 301 searches for aneighborhood AP, for example, by scanning a wireless LAN. Then in stepF703, when the communication apparatus 301 receives a response signalfrom the access point 304, the communication apparatus 301 selects thenetwork 306 as a roaming destination.

After the communication apparatus 301 selects the network 306, then instep F704, the communication apparatus 301 performs the networkswitchover process described in FIG. 4. Since the ad-hoc modecommunication is not available on the wireless LAN channel c, thecommunication apparatus 301 ends the communication of the infrastructuremode and continues the ad-hoc mode communication.

Thus, by performing the switchover process described in FIG. 4, thepriority communication mode can continuously be performed and thenon-priority communication mode can swiftly end, when the wireless LANchannel is changed to the channel in which the ad-hoc mode communicationis not available.

According to the present exemplary embodiment, in a case where acommunication apparatus participates in a network in which communicationfor connection to the base station is performed and communication isperformed without connection to the base station, when a process ofchanging the base station is detected, a process can be performed to besuitable for the frequency channel of a base station of the changedestination. For example, in a case where the frequency channel of thebase station of the change destination can be used even in thecommunication performed without connection to the base station, thechange in the frequency channel can be notified of. Therefore, thefrequency channel of another communication apparatus can swiftly bechanged. Further, in a case where the frequency channel of the basestation of the change destination cannot be used in the communicationperformed without connection to the base station, either communicationcan be prioritized to be performed between the communication forconnection to the base station and the communication performed withoutconnection to the base station. Since the user can set the communicationto be prioritized, the usability can be improved.

The exemplary embodiment of the present invention has hitherto beendescribed, but the exemplary embodiment is an example of the descriptionof the invention. The scope of the invention is not limited only to theexemplary embodiment. The exemplary embodiment may be modified invarious forms within the scope of the invention without departing fromthe gist of the invention. Further, the example of the wireless LANconforming with the IEEE 802.11 has been described. However, theexemplary embodiment may be applied to other wireless media, such as awireless universal serial bus (USB), multi band orthogonal frequencydivision multiplexing (OFDM) alliance (MBOA), Bluetooth (registeredtrademark), a ultra-wideband (UWB), and ZigBee (registered trademark).

Herein, the UWB includes a wireless USB, wireless 1394, and WiNET.

Aspects of the present invention can also be realized by a computer of asystem or apparatus (or devices such as a CPU or MPU) that reads out andexecutes a program recorded on a memory device to perform the functionsof the above-described embodiment (s), and by a method, the steps ofwhich are performed by a computer of a system or apparatus by, forexample, reading out and executing a program recorded on a memory deviceto perform the functions of the above-described embodiment (s). For thispurpose, the program is provided to the computer for example via anetwork or from a recording medium of various types serving as thememory device (e.g., computer-readable medium).

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all modifications, equivalent structures, and functions.

This application claims priority from Japanese Patent Application No.2011-263420 filed Dec. 1, 2011, which is hereby incorporated byreference herein in its entirety.

What is claimed is:
 1. A communication apparatus comprising: a firstcommunication device configured to perform communication by connectingto a base station; a second communication device configured to performcommunication without connection to a base station; a determinationdevice configured to, in a case where the communication apparatusconnects to a first network of a first base station via a firstfrequency channel by the first communication device and thecommunication apparatus participates in a second network via the firstfrequency channel without connection to the base station by the secondcommunication device, determine whether a second frequency channel usedby a second base station is usable in the communication performed by thesecond communication device; and a control device configured to controlthe communication without connecting to the base station by the secondcommunication device according to the second frequency channeldetermined by the determination device.
 2. The communication apparatusaccording to claim 1, wherein, in a case where the second frequencychannel is usable in the communication performed by the secondcommunication device, the control device performs a process for changingfrom the first base station to the second base station and transmits, tothe second network, information indicating that the first frequencychannel is changed.
 3. The communication apparatus according to claim 1,wherein, in a case where the second frequency channel is usable in thecommunication performed by the second communication device, the controldevice performs a process for changing from the first base station tothe second base station and transmits, to the second network,information indicating the second frequency channel.
 4. Thecommunication apparatus according to claim 1, wherein, in a case wherethe second frequency channel is unusable in the communication performedby the second communication device, the control device ends thecommunication performed by the second communication device and performsa process for changing from the first base station to the second basestation.
 5. The communication apparatus according to claim 1, wherein,in a case where the second frequency channel is unusable in thecommunication performed by the second communication device, the controldevice continues the communication performed by the second communicationdevice via the first frequency channel without performing a process forchanging from the first base station to the second base station.
 6. Thecommunication apparatus according to claim 1, further comprising astorage device configured to store information used to determine whetherthe communication performed by the first communication device isprioritized or the communication performed by the second communicationdevice is prioritized, wherein, in a case where the second frequencychannel is unusable in the communication performed by the secondcommunication device, the control device performs one of first processfor ending the communication performed by the second communicationdevice and changing from the first base station to the second basestation and second process for continuing the communication performed bythe second communication device via the first frequency channel withoutperforming changing from the first base station to the second basestation, according to the information stored in the storage device. 7.The communication apparatus according to claim 6, wherein theinformation used to determine whether the communication performed by thefirst communication device is prioritized or the communication performedby the second communication device is prioritized is set by a user. 8.The communication apparatus according to claim 1, wherein the firstcommunication device and the second communication device communicateswirelessly.
 9. A method for controlling a communication apparatus thatincludes a first communication device configured to performcommunication by connecting to a base station, and a secondcommunication device configured to perform communication withoutconnection to a base station, the method comprising: in a case where thecommunication apparatus connects to a first network of a first basestation via a first frequency channel and the communication apparatusparticipates in a second network via the first frequency channel withoutconnection to the base station, determining whether a second frequencychannel used by a second base station is usable in the communicationperformed by the second communication device; and controlling thecommunication without connection to the base station by the secondcommunication device according to a result of the determination.
 10. Themethod according to claim 9, wherein, in a case where the secondfrequency channel is usable in the communication performed by the secondcommunication device, the controlling includes performing a process forchanging from the first base station to the second base station andtransmitting, to the second network, information, indicating that thefirst frequency channel is changed.
 11. The method according to claim 9,wherein, in a case where the second frequency channel is usable in thecommunication performed by the second communication device, thecontrolling includes performing a process for changing from the firstbase station to the second base station and transmitting, to the secondnetwork, information indicating the second frequency channel.
 12. Themethod according to claim 9, wherein, in a case where the secondfrequency channel is unusable in the communication performed by thesecond communication device, the controlling includes ending thecommunication performed by the second communication device andperforming the process for changing from the first base station to thesecond base station.
 13. The method according to claim 9, wherein, in acase where the second frequency channel is unusable in the communicationperformed by the second communication device, the controlling includescontinuing the communication performed by the second communicationdevice via the first frequency channel without performing a process forchanging from the first base station to the second base station.
 14. Themethod according to claim 9, further comprising storing information usedto determine whether the communication performed by the firstcommunication device is prioritized or the communication performed bythe second communication device is prioritized, wherein, in a case wherethe second frequency channel is unusable in the communication performedby the second communication device, the controlling includes performingone of first process for ending the communication performed by thesecond communication device and changing from the first base station tothe second base station and second process for continuing thecommunication performed by the second communication device via the firstfrequency channel without changing from the first base station to thesecond base station according to the stored information.
 15. The methodaccording to claim 14, wherein the information used to determine whetherthe communication performed by the first communication device isprioritized or the communication performed by the second communicationdevice is prioritized is set by a user.
 16. The method according toclaim 9, wherein the first communication device and the secondcommunication device communicates wirelessly.
 17. A non-transitorycomputer-readable storage medium storing a program that causes acomputer to execute a method for controlling a communication apparatusthat includes a first communication device configured to performcommunication by connecting to a base station, and a secondcommunication device configured to perform communication withoutconnection to a base station, the method comprising: in a case where thecommunication apparatus connects to a first network of a first basestation via a first frequency channel and the communication apparatusparticipates in a second network via the first frequency channel withoutconnection to the base station, determining whether a second frequencychannel used by a second base station is usable in the communicationperformed by the second communication device; and controlling thecommunication without connection to the base station by the secondcommunication device according to a result of the determination.
 18. Acommunication apparatus comprising: a first communication device whichconnects wirelessly to a base station; a second communication devicewhich performs wireless communication without connection to a basestation; 205 a control device which terminates, in a case where thecommunication apparatus connects to a second base station different froma first base station, to which the communication apparatus isconnecting, the communication by the second communication deviceaccording to a frequency channel of the second base station.
 19. Thecommunication apparatus according to claim 17, wherein the controldevice terminates, in that case the frequency channel of the second basestation is prohibited in the communication without connection to thebase station, the communication by the second communication device, thecontrol device continues, in that case the frequency channel of thesecond base station is not prohibited in the communication withoutconnection to the base station, the communication by the secondcommunication device.
 20. The communication apparatus according to claim17, wherein the control device continues the communication by the secondcommunication device and terminates the communication by the firstcommunication device, in that case the frequency channel of the secondbase station is prohibited in the communication without connection tothe base station and the communication apparatus prioritizes thecommunication by the second communication device than the communicationby the first communication device.